'use strict';
const MESSAGE_ID = '<%= id %>';
const messages = {
	[MESSAGE_ID]: 'Prefer `{{replacement}}` over `{{value}}`.'
};

/** @param {import('eslint').Rule.RuleContext} context */
const create = context => {
	return {
		Literal(node) {
			if (node.value !== 'unicorn') {
				return;
			}

			return {
				node,
				messageId: MESSAGE_ID,
				data: {
					value: 'unicorn',
					replacement: '🦄'
				}<% if (fixableType) { %>,
				/** @param {import('eslint').Rule.RuleFixer} fixer */
				fix: fixer => fixer.replaceText(node, '\'🦄\'')<% } %>
			};
		}
	}
};

const schema = [];

/** @type {import('eslint').Rule.RuleModule} */
module.exports = {
	create,
	meta: {
		type: '<%= type %>',
		docs: {
			description: '<%= description %>'
		},<% if (fixableType) { %>
		fixable: '<%= fixableType %>',<% } %>
		schema,
		messages
	}
};
